package Demo10.hongbao;

public class DemoMain {
    public static void main(String[] args) {
        Computer computer = new Computer();
        computer.powerOn();

       // Mouse mouse = new Mouse();
        USB usbMouse = new Mouse();//多态写法
        computer.useDevice(usbMouse);

        Keyboard keyboard = new Keyboard();
        computer.useDevice(keyboard);
        computer.powerOff();

    }
}
